package com.woniu.apiBoss.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.internalcommon.dto.*;
import com.woniu.internalcommon.remote.ServiceDriverUserClient;
import com.woniu.internalcommon.remote.ServicePriceClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zcnovice
 * @data 2025/7/15 上午9:50
 */
@Service
@Slf4j
public class ApiDriverService {
    @Autowired
    private ServiceDriverUserClient  serviceDriverUserClient;

    /* 修改司机信息 */
    public ResponseResult update(DriverUser driverUser) {
        ResponseResult deleteById = serviceDriverUserClient.updateDriverUser(driverUser);

        return deleteById;
    }

    /* 删除司机信息 */
    public ResponseResult  delete(Long id) {
        ResponseResult update = serviceDriverUserClient.deleteById(id);
        return update;
    }

    /* 增加司机 */
    public ResponseResult add(DriverUser driverUser) {
        ResponseResult add = serviceDriverUserClient.addDriverUser(driverUser);
        return add;
    }


    /* 条件查询司机 */
    public ResponseResult<Page<DriverUser>> find(ApiBossDriver apiBossDriver) {
        log.info("查询所有车辆,参数:{}",serviceDriverUserClient.findDriver(apiBossDriver));
        return serviceDriverUserClient.findDriver(apiBossDriver);
    }



    /* 绑定汽车 */
    public ResponseResult binding(DriverCarBindingRelationship driverCarBindingRelationship) {
        ResponseResult binding = serviceDriverUserClient.binding(driverCarBindingRelationship);
        return binding;
    }



    /* 解绑汽车 */
    public ResponseResult unbind(DriverCarBindingRelationship driverCarBindingRelationship) {
        ResponseResult unbind = serviceDriverUserClient.unBinding(driverCarBindingRelationship);
        return unbind;
    }

    public ResponseResult<Page<DriverUser>> getAll(Integer current, Integer size) {
        return serviceDriverUserClient.getAll(current,size);
    }

    public ResponseResult<Page<Car>> getAllCar(ApiBossCar  apiBossCar) {
        return serviceDriverUserClient.getAllCar(apiBossCar);
    }
}
